﻿/**
 * @author sminutoli
 * version 1.0
 */

import com.dinmax.flash.utilities.movieclip.MovieClipUtils
import com.dinmax.flash.draw.cabeza.ControlCabeza
import com.dinmax.flash.draw.cabeza.ScrollCabeza
import com.dinmax.flash.draw.cabeza.ButtonCabeza
import com.dinmax.flash.central.bridge.CONTACTItemBridge

class com.dinmax.flash.central.bridge.WINDOWContactBridge
extends com.dinmax.flash.draw.cabeza.WindowCabeza
implements com.dinmax.flash.draw.cabeza.SelectedListener {
	
	private static var LINK_ID:String = "ContactItem";
			
	public function drawItem(phone:Number, nick:String, mail:String, visibility:String):MovieClip {
		var clip:MovieClip = super.drawItem(WINDOWContactBridge.LINK_ID);
		var item:CONTACTItemBridge = CONTACTItemBridge(clip);
		item.setLabel(nick);
		item.setExtID(phone);
		item.setPhone(phone);
		item.setMail(mail);
		item.setVisibility(visibility);
		this.getScrollV().setStep(clip._height);
		
		return clip;
	};
	
	public function initChild(control:ControlCabeza):Void {
		super.initChild(control);
		if(control instanceof CONTACTItemBridge) control.addListener(this);
		
	};
	
	private function initScrollV():Void {
		super.initScrollV();
		this.getScrollV().setMouseWheel(true, this);
	};
		
}